/**
 * 模板引擎
 */


 const Koa = require('koa')
 const views = require('./koa-views')
 const app = new Koa()

 app.use(views(__dirname + '/views', {
    map: {
      html: 'ejs'
    }
  }));

  app.use(async  (ctx) => {
   
   
    await ctx.render('index', {
      name: 'John'
    });
  });

 app.on('error',(e)=>{
     console.log(e)
 })
 app.listen(3000)